Using Logic to Rotate Images