If you don’t need the batching, shuffling, or the usage of multiple workers from the DataLoader, you could directly access the image_datasets with the index.
Note that you would need to add a batch dimension to your data and target, since the Dataset will not create this dimension for you.
Alternatively, if you want to use the DataLoader, I would recommend to implement a custom sampler, which gives you the ability to specify which indices are returned in which step.