Images presented at different rates

OS (e.g. Win10): MacBook v10.10.5
PsychoPy version (e.g. 1.84.x): v3.2.4
What are you trying to achieve?:

I am creating an experiment where I am presenting 10 images on the screen. However, I want half the images to be presented 4 times total throughout the loop, and the remaining 5 images to only be presented once. They need to be in a random order but there should be a minimum of 3 other image trials before an image is shown again (so for example, you can’t show an image, show another image, and then show that first image again in the next trial). Can anyone help me in figuring these two things out?

Thank you.