Stop relying on float division.

In some cases, where x and y are both ints, int(x/(x/y)) != y. It's easier to
not rely on this at all and use the original dimensions when possible.