Added maximum zoom factor to prevent rounding errors and scaling by infinity.