In the head, you'll need to paste the following code:
<script type="text/javascript" language="JavaScript">
    MyImages=new Array();
    MyImages[0]='1.jpg';
    MyImages[1]='2.jpg';
    MyImages[2]='3.jpg';
    MyImages[3]='4.jpg';
    function newImage()
    {
        document.getElementById("mainImage").setAttribute("src",
MyImages[Math.round(Math.random()*3)])
    }
</script>
You'll obviously need to change the file names to what ever files you want to load.
In the <body> tag, you'll also need to add onload="newImage()", so you get something like
<body onload="newImage()">
Finally, you need to make sure that you have an image with an ID of "mainImage" on your page
somewhere.  If you don't, you'll get JavaScript errors.
<img id="mainImage" />
Random Image Loading With JavaScript