Fixes drawImage for thumbs

Fixes #4921

And don't think we need to worry fixing #2888 as well, thumb nails just to quickly locate the page and not read it.
you could use 4 as max scale factor.
the while loop will trigger when for example the needed scale is 2.1, which will downscale to 1.1 which then the final draw will make to 1.0.
by using a scale like 4, the last draw Image call will get some more downscaling to do, effectively cutting down one loop with little noticeable effect.