added cache functionality to store tiles as individual files