Caching inlined mask images
Heuristic to optimize chunking