Main gallery update

Made the gallery work for different aspect ratios