[Fixes bug #1164222] Fix crash with small images with the Pixel Grid on.

Fixed a potential crash in the Open Images pad when opening small images
with the Pixel Grid enabled. Also, the Pixel Grid is now disabled for
previews in the Open Images pad, since it looks terrible.
Fix printing crashes on Windows.

See https://bugzilla.novell.com/show_bug.cgi?id=380675
[Fixes bug #1123541] Fix crash when cropping after using the Text Tool.

Also fixed similar crashes when resizing the canvas or image.