<div id="coub">
<div class="coub" onmouseover="showName(this);">
<a href="//coub.com/view/eeuyn" onclick="return frame(this);">
<img src="https://3fc4ed44-3fbc-419a-97a1-a29742511391.selcdn.net/coub_storage/coub/simple/cw_image/f42a9c98bfd/f876723cdbb307c191e94/1472200578_00031.jpg"></a>
<span>Watch on the road! #jimdrives</span></div>
<div class="coub" onmouseover="showName(this);">
<a href="//coub.com/view/2q1t7k" onclick="return frame(this);">
<img src="https://3fc4ed44-3fbc-419a-97a1-a29742511391.selcdn.net/coub_storage/coub/simple/cw_image/27475bd9033/6a9fb30fb888702736ce6/%{version}_1615659518_00032.jpg"></a>
<span>Everyone!</span></div>
</div>
const images = Array.from(document.querySelectorAll('img'));
images.forEach((image) => {
let src = image.getAttribute('src');
src = src.replace('%{version}', 'small');
image.setAttribute('src', src);
});