simplify mergeTiles a bit