Hello,i need help in my gallery

I have develop a gallery where I put my all gallery images. Well i know the how do that but I have stuck which best for me grid or flex with responsive design

Following example

I build the same in react let me know how can do this gallery.

There are lots of tutorials and real projects on youtube and others that show how to create an image gallery either with CSS Flexbox or CSS Grid. In either case, I believe you will be needing very little js code.