added number checking for image cropping