fixed possible segfault if tileHeader.numTiles == 0;