What I would do is preload the images into three separate shuffled lists and then use .pop() to take an image from the appropriate list on each trial.
Have a look at some of my online demos from PsychoPy Online Demos such as Complex Randomisation (which preloads in code), Independent Randomisation, or Trial Switching