Fix `prerender` flag with scrolling layers.
Reuse code for TMX and TSX loader.