changed tileset cache to be an associative array with the key as the index of the array.