Javascript version of image shear