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 zoom levels to
each preset, and removing the non-preset version if the
ratio is below the threshold. This also removes any duplicate
values from the list of zoom levels.