better cache behaviour

Cache enough tiles from each slice to be able to paint a 1920 x 1080
desktop, plus a bit.

Previously we cached the smallest layer unconditionally, which could use
a lot of memory for some slides. Thanks to bgilbert for the suggestion.