fixed bug in max-height capping during crop

and added fallback if crop x and y exceed cropped dimensions

y dimensions were being calculated using width not height
if an x or y dimensions was greater than the new width, it would fall back to the gravity center.
Now, it positions crop at far right/bottom.