Now that will work in this simple test case shown below but the background position is being set on your .wraph.active styles in the first fiddle you posted, that will need to be taken into account.
But for the sake of testing I just moved the bg position up 1/2 way with -303px to show how it would work.
Run this page, then reload and you will get random backgrounds. It is possible to get the same BG image 2-3 times in a row though from what I see. Keep hitting reload and it will change.
Note that I have changed <img id="image" /> to <div id="image"></div>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Test Page</title>
<style>
#image {
position: relative;
width: 606px;
height: 606px;
background-position: 0px -303px; /* test bg position*/
/*bg position would go on your .wraph.active styles as seen in other demo*/
}
</style>
</head>
<body>
<div id="image"></div>
<script>
var images = [
"https://i.imgur.com/oAfqb2E.png",
"https://i.imgur.com/gaijZc5.png",
"https://i.imgur.com/3v4t6X1.png"
];
function randImg() {
var size = images.length
var x = Math.floor(size * Math.random())
document.getElementById('image').style.backgroundImage = 'url(' + images[x] + ')';
}
randImg();
</script>
</body>
</html>