I found this code to make a image gallery, but the photos are rectangle and I would like it for them to be a square(like the products in collections)
Does anyone know what I need to change? This is the code
{% assign grid_item_width = "medium--one-half large--one-third" %}
{% if section.blocks.size == 1 %}
{% assign grid_item_width = "medium--one-half large--one-third" %}
{% elsif section.blocks.size == 2 %}
{% assign grid_item_width = "medium--one-half large--one-third" %}
{% endif %}
{% for block in section.blocks %}
{% if block.settings.image == blank %}
{% capture current %}{% cycle 1, 2, 3, 4, 5, 6 %}{% endcapture %}
{{ 'collection-' | append: current | placeholder_svg_tag: 'placeholder-svg' }}
{% else %}
{{ block.settings.button_label | escape }}
.row {
display: flex;
flex-wrap: wrap;
padding: 0 4px;
}
/* Create four equal columns that sits next to each other */
.column {
flex: 25%;
max-width: 25%;
padding: 0 4px;
}
.column img {
margin-top: 8px;
vertical-align: middle;
width: 100%;
}
/* Responsive layout - makes a two column-layout instead of four columns */
@media screen and (max-width: 500px) {
.column {
flex: 50%;
max-width: 50%;
}
}
/* Responsive layout - makes the two columns stack on top of each other instead of next to each other */
@media screen and (max-width: 500px) {
.column {
flex: 100%;
max-width: 100%;
}
}
{% endif %}
{% endfor %}