Fix width/height order for image rotation