JSFiddle - React, Tailwind, and code Playground

HTML

<img src="http://example.ru/01/kmg05-300x214.jpg" class="attachment-portfolio-three" alt="kmg05">

JavaScript

$(document).ready(function() {
    var img = $('.attachment-portfolio-three');
    var source = img.attr('src');
    var str = "-300x214";
    if (source.toLowerCase().indexOf(str) >= 0)
    {
        source = source.replace(str, "");
        img.attr("src", source);
    }
});