I tried that, with shuffle=False as well, but the error still comes randomly.
I also went through the whole dataset (which isnt too large luckily) thrice, and 1 time i got a None at a certain image file and when i checked it out it was not corrupted or missing. The other 2 runs, I didnt get a None. I even changed my workflow from Jupyter notebook to a more class-based IDE setup just in case Jupyter was messing with me.
Also an important thing I may have not told originally in the first post (now I edited it there) was this message that I get
Exception NameError: "global name 'FileNotFoundError' is not defined" in <bound method _DataLoaderIter.__del__ of <torch.utils.data.dataloader._DataLoaderIter object at 0x7f13cacc8c90>> ignored