Fix gallery alignment math