Fixed tile layout to work correctly with changing columns and number of masters