I don’t think you can do that inside the __getitem__ function. But, if you create a list like self.data, then you can append multiple copies of this image to the list in the __init__. Then, in __getitem__ you retreieve items from the list self.data.