Precedence of images on screen in JS/ Pavlovia

URL of experiment: Pavlovia

Description of the problem:
Hi there,
There is some inconsistency with image presentation precedence during the feedback phase of my experiment when I pilot it in the browser. What I am trying to accomplish is “highlighting” the choice selected by the participant. The way I do this is by presenting a red box behind the selected stimulus, so it appears as a frame around the stimulus. It works without a problem in psychopy, but in Pavlovia, it works fine on some of the trials, but on others, the red box appears in front of the chosen stimulus and occludes it (and there is also a numerical stimulus that is sometimes occluded by the other stimuli). I can’t figure out the cause of this: the depth parameter looks fine in the psychojs code, although I saw under ImageStim — PsychoPy v2021.1 that in psychopy depth is “DEPRECATED, depth is now controlled simply by drawing order”. Not sure what this means this means for psychojs. It is also perplexing that this issue happens intermittently. I would appreciate any help / insights / suggestions.
Thank you!

In my experience an object gets moved to the front of it gets edited.

Therefore if you edit a background object you need to force a change to the foreground objects to keep them in front.