cropping images
cleaned up code