Caching TileStore: Fix NPE for NULL tiles and improve exception handling