Thank you, Jeremy! This code works great!
One more question. If I wanted a 3×3 grid with images so that the bear and flower would be at random positions from one trial to another, I think I would need to use the selector command with the shuffle argument. Where would I plug it in this code?