I started logic in one of my projects that I am working on. This is not WordPress. I want to display multiple images, maybe 1,2,3 .... up to 10 in one container div, which will be loaded from the backend system. This should appear in a single view similar to the one shown below.

I tried to arrange the images in a div container without JavaScript. I am new to jQuery and find it difficult, but don't know how to do this.
Codepen Example here
I know this is possible using only jQuery.
If you need more clarification, please comment, I will update my question.
**
Note. A Facebook post has several images in one view. I am trying to draw the same conclusion.
**
source