fix over-fetching slices
I was getting an error when hdf5 file only has 10k images with following toml setting. I'm using 3 ranks in mpi mode: -n3 -G3
N_images_per_rank = 1500 N_batch_size = 500 N_images_max = 3000
Fetching logic was somewhat complex, but I hope this fixes it.