Modified version of imagecrop