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)
I think this is the problem. Instead of Resize(256) try, Resize(256,256). This will alter the aspect ratio. But, first check and let us know the outcome.