Halu and welcome aboard!
Yes, there is a solution to your problem, in fact I think your description was very well put.
Take a look at this code, written by Danne [or choose Spookster's version if you find it more attractive] in
this thread
Code:
<script type="text/javascript">
function setImg(newImg){
var obj=document.getElementById("dynImg");
obj.src=newImg;
}
</script>
<body onLoad="setImg('example01.jpg');">
...
<img id="dynImg" onError="this.src='noimageavail.jpg';">
Hope that helps,