I can’t see your images due to me being on a phone, and it looks like you haven’t got to the mobile view yet. What about using flex box? And using flex-wrap?
Super quick way it can be done, this is without any media queries so it’s not a 3 by n grid. But it’s just to show a grid version. I have commented out the style rules, that needs removing.