Fixes drawImage for thumbs
Limit the size of canvases to 5MP (iOS restriction)
Cache pages at the start of drawing, not the end.
Fix mishandling of incomplete, inverted masks.
Merge pull request #4932 from nnethercote/cache-pages-earlier

Cache pages at the start of drawing, not the end.
Merge pull request #4924 from yurydelendik/fixthumb

Fixes drawImage for thumbs
Merge pull request #4933 from nnethercote/fix-4926-masking

Fix mishandling of incomplete, inverted masks.
Merge pull request #4834 from dferer/canvas-max-size

Limit the size of canvases to 5MP (iOS restriction)
Halve the size of the PageView cache.
Fix PageView cache re-insertions.
Merge pull request #4937 from nnethercote/smaller-cache

Halve the size of the PageView cache.
Merge pull request #4936 from nnethercote/fix-cache-splice

Fix PageView cache re-insertions.