I don’t think it is related to your batch size, since each sample is loaded independently in your Dataset.__getitem__ method.
Your image might be corrupt.
You could try to find this image using a simple loop over your Dataset:
dataset = MyDataset()
for idx, (data, target) in enumerate(dataset):
      print(idx)

The corrupt file should be at idx+1, so that you could check the file name using this index.