Changing this code I achieved what I needed.
.product-single__thumbnails-item--medium {
@include media-query($medium-up) {
flex: 0 0 percentage(1 / 3);
}
@include media-query($large-up) {
flex: 0 0 15%;
}
}
In the theme.scss.liquid file look for a code fragment like the one above, the flex property will be 0 0 25%, which means that there will be 4 images under the main one. Just change the percentage according to your needs. In my case I put it on 15%.