You could write your custom Dataset as described in the Data loading tutorial 570.
Basically, you would provide the image paths in the __init__ method, while loading and transforming each sample in __getitem__.