Corrected dynamic sizing of gridlayout and updated when button is removed