This Masonry grid has to take into account both differing height and widths. Any hint on how to do this?
Bootstrap has an implementation of this called card-columns. It works very well for your requirements.
card-columns