Resizes an image to square dimensions