Grid elements reposition when container size changes