Help with creating an random image link

I want an random image link to my homepage, and I have through reading some tutorials succseded in getting the random image effect. But the problem is that I want that the random image’s should be links so that the image that randomly show’s will, when clicked take me to another page on my site. But I haven’t got this to work eventhough I have read some diffrent tutorials, I just don’t know how to get my random image to be a link? Can someone help me out with this one?