Javascript gallery won't format until i resize document

For some reason, my document is displaying improperly, but when I adjust the size in editor, it seems to reformat into the proper format. How can I make the document format this way from the beginning?

my code : https://codepen.io/daniel-albano/pen/ExaMZjm?editors=0110

What do you call improper? Just saw your link. It looks nice.

1 Like

They are displaying stacked on top of each other until you resize the page

What could I change the resize element to in order to make this happen right away?