I just scrolled down your code and realised that you are trying to insert a coder experiment into Builder. Have a look at my RSVP demo (linked here Recording response after current trial loop end) for three ways of how to manipulate image components during a routine.
Builder experiments should not contain “while” loops, core.wait or win.flip for presentation.
Here’s another recent thread where I rewrote a simple experiment to make it more compatible with Builder.