fixed bug in max-height capping during crop
and added fallback if crop x and y exceed cropped dimensions