Не совсем понял, куда подставлять 1,2,...
Но принцип такой.
<div class="images">
<div class="grid-item"><img src="120x120" alt=""></div>
<div class="grid-item span-2"><img src="240x240" alt=""></div>
<div class="grid-item"><img src="120x120" alt=""></div>
<div class="grid-item"><img src="120x120" alt=""></div>
<div class="grid-item"><img src="120x120" alt=""></div>
<div class="grid-item span-3"><img src="240x240" alt=""></div>
<div class="grid-item"><img src="120x120" alt=""></div>
<div class="grid-item"><img src="120x120" alt=""></div>
<div class="grid-item"><img src="120x120" alt=""></div>
<div class="grid-item"><img src="120x120" alt=""></div>
</div>
<script>
document.querySelectorAll(".images img").forEach((el,i) => el.src = 'https://via.placeholder.com/' + (i + 1) + el.getAttribute('src'));
</script>