This looks like a quick and valid approach. You could of course derive a custom class from ImageFolder, but if you don’t need any other changes, I would probably just use yours.
Thanks @ptrblck
It worked pretty well, as I passed a loader that read the images according to my needs, and a custom transform that plays with the images the way I want. Needless to say that DatasetFolder is also a very nice option/alternative as one can pass the extensions of the files to load.