Based on the error message it seems that the second image tensor is a grayscale image (single channel), while the first one contains 3 channels.
You could either transform both images to grayscale or RGB to create matching shapes.