looks like this is the code that will work
@media(max-width:767px) {
.gallery-masonry-item {
width: 100% !important;
transform: unset !important;
position: unset !important;
margin-bottom: 20px !important;
}
.gallery-masonry-item-wrapper {
height: unset !important;
}
.gallery-masonry-wrapper {
height: unset !important;
}
}