Cleaning up the image cropping functionality