[composer] Follow up da5766c, fix picture rotation calculation

Previous commit failed to address the issue for non-squareish
images.