After editing an image which changes its size (crop, resize) or
undoing this operation the image is not centered in the viewport
in some cases.
This patch adds a check if document size changed when calculating
zoom factor and view offset.
FIXED-IN: 18.04.1