Fix a resizing and cropping bug