Round the calculated image width and height (see #7343)