Atlas builder now generates correct tile indices