Resizes an image or volume by cropping and padding.