Yeah the problem is that you can’t really know what margin needs to be applied.
Apart from manual margins being set, you need JS for this.
I almost have it done except for fixing out the source order of it. That codepen in the last post includes the masonry.js and then a small JS snippet.
Sorry.