Forum Moderators: open
So that leaves either client side things like javascript or any server side coding.
If you specifically seek a refresh and not just a random image, you'll need a way to track this is a refresh, so a likely choice would be session tracking server side and solving it there.