If you only have a single image (and target), you don’t necessarily need to wrap it in a Dataset.
Usually you would like to load more than a single sample, so that the index in __getitem__ is used to select the current sample.
This is done via lazy loading:
You would pass e.g. a list of paths to __init__ and load each image/file in __getitem__ by selecting the path to the current image from the passed list. Here is a small dummy example (without loading a target)
class MyLazyDataset(Dataset):
    def __init__(self, image_paths, transform=None):
        self.image_paths = image_paths
        self.transform = transforms # e.g. transforms.ToTensor()
        
    def __getitem__(self, index):
        # Get current path
        current_image_path = self.image_paths[index]
        # Load sample
        x = Image.open(current_image_path)
        # Apply transformation, if defined
        if self.transform is not None:
            x = self.transform(x)
        return x

    def __len__(self):
        # return number of images
        return len(self.image_paths)

Alternatively, you could also preload the data, if it’s small:
class MyDataset(Dataset):
    def __init__(self, data):
        self.data = data # data could have the shape [nb_samples, 3, 224, 224]
        
    def __getitem__(self, index):
        x = self.data[index]
        # x will have the shape [3, 224, 224]
        return x

    def __len__(self):
        # return number of images
        return len(self.data)

Since your loaded tensor has the shape [250, 250], indexing it in the first dimension will return a tensor with the shape [250].