Give priority to tiles stored in a temporary folder rather than serving the original image data.

Also, fix tile cutting in the script.