You could check if the image is None before the resize call.
If that’s the case you could randomly pick a new index and load another image. That will make things unclear, e.g. when shuffle=False, but for the moment your DataLoader does not crash.
Try to find the image using its index and fix it or delete it.