Prevent tile_index and tile_id to overflow on large maps (width * height > 32000)