.gallery-flex { display:flex; flex-direction: row; flex-wrap: wrap; justify-content: center; img { margin:1em; } }