<a href="https://jsfiddle.net/a9Ltw/"> Fiddle Sample</a><br />
<br />
HTML<br />
<button>Click me</button><img id="randImg" src="brokenImage.png" alt="randomImage" /><br />
<br />
JS Jquery<br />
$("button").click(function(){<br />
    var randomImage = 1 + Math.floor(Math.random() * 20);    <br />
    var imgName = randomImage+".png";<br />
    $("#randImg").attr("src",imgName);<br />
    $("button").text("Current random Image: "+imgName);<br />
});