modified to work with multiple Tiled tile sets properly