fix the cardinal rotation functions 90/180/270 so they work with non-square images