If device and image orientation differ, rotate the image before drawing the puzzle.

Fixes #1