Revamped the grid list function to be much more versatile