fix an issue with upright layout where there could be an empty row of tiles