Add smarter logic for removing unnecessary zoom levels

Some zoom levels end up being very close to the built-in presets
(fit-width/fit-height/auto), which makes zooming previous or next
level kind of annoying when the zoom level barely changes. This fixes
that by applying a threshold to the quotient between each consecutive
zoom level, and removes that zoom level if the ratio is below the
threshold. This also removes any duplicate values from the list of
zoom levels.