You won't be able to create that 'masonry type layout' easily using bootstrap or flex.
There's a css example here that talks through the problems.
CSS columns are probably the best approach. I've modified a bootstrap layout here with the necessary rules.
You;ll have to add media queries etc for smaller screens and reduce trhe column count accordingly.
This is untested in anything but Chrome so needs further testing in other modern browsers but I am out of time today. (CSS columns had a few bugs last time I tried anything complicated vbut may have improved since.)