Firstly, I’d suggest you reduce the demo to just the relevant HTML & CSS.
No-one likes to have to wade through dozens of lines of irrelevant code to narrow down your issue.
Also, what gaps? It looks to me as though you images aren’t large enough to fill their divs….not that there are gaps between the divs.
A minimal demo is needed here.