You could write a custom Dataset to load the images and their corresponding masks.
Have a look at the Data loading tutorial 2.1k for a basic approach.
Here 890 is a dummy implementation using the functional API of torchvision to get identical transformations on the data and target images.