Could you pass the size argument to Resize as a sequence, since an int value would only resize the smaller edge to this shape in case the inputs are not quadratic.
From the docs 12:

size (sequence or int) – Desired output size. If size is a sequence like (h, w), output size will be matched to this. If size is an int, smaller edge of the image will be matched to this number. i.e, if height > width, then image will be rescaled to (size * height / width, size). In torchscript mode padding as single int is not supported, use a tuple or list of length 1: [size, ] .