Actually I had the same question, but reply not 100% correct. For masonry layout you don’t need to change columns settings of the image. Just use different layout images and gallery resize thumbnails to make layout which looks like masonry view. For my case it’s work properly.
@knize, just try user proper size images in default gallery layout.