you cold have random access - the computer picks the random image and not the user - just pick one image in advance!
...user clicks 'next', computer displays pre-loaded image, computer picks another image at random and preloads it (for next time the user clicks 'next')...
...user clicks 'next', computer displays pre-loaded image, computer picks another image at random and preloads it (for next time the user clicks 'next')...