You don’t necessarily need a custom Dataset, if you unsqueeze the missing dimension before passing the tensor to TensorDataset.
Based on the error it seems the loaded numpy array is already missing the channel dimension (i.e. the RGB channels) so you could check how these arrays are created.