If, you need to define your own custom dataset, you can load both images in __getitem__ method by using CustomDataset. Here is post for such a situation: Custom Dataset with some preprocessing 2
Also, dataloading tutorial 2 has complete info about problems with customized data.
Bests