I've posted something like this on another forum before, I'll try to find it and repost it here.
EDIT: Nvm, script turned out to be quite different to what you're after and I've not got the time to modify it really. If you want a go at modifying yourself, see
http://www.watchsg1.com/randomBanner.zip, but it's not really what you're after - just a glorified random image script really.