JSFiddle - React, Tailwind, and code Playground

HTML

<div>
    <img src="http://placehold.it/150x100">
    <img src="http://placehold.it/150x150/225599/ffffff">
    <img src="http://placehold.it/150x150">
    <img src="http://placehold.it/150x150">
    <img src="http://placehold.it/150x150">
</div>
<div>
    <img src="http://placehold.it/150x100">
    <img src="http://placehold.it/150x150/225599/ffffff">
    <img src="http://placehold.it/150x150">
    <img src="http://placehold.it/150x150">
</div>
<div>
    <img src="http://placehold.it/150x100">
    <img src="http://placehold.it/150x150/225599/ffffff">
    <img src="http://placehold.it/150x150">
</div>

CSS

div {
    background-color: #66BB66;
    display: flex;
    justify-content: space-between;
}
img {
    margin-left: auto;
    margin-right: auto;
}
img:first-child {
    position: absolute;
}
img:nth-child(2) {
    margin-left: 0;
}
img:last-child {
    margin-right: 0;
}