Is there any reason why you load all of your images during init ?

That was the error (and it makes lots of sense ) .
Now, I store the image paths during __init__ and load the images during __getitem__, as you mentioned. It works perfectly.
Thanks,