Thanks for your response. The solution works great. I have a follow-up question. When the second trial starts, the canvas seems to get doubled in size and I have to scroll down to see the images although there’s both a .clear () and a .remove () command in the script that should’ve removed the canvas from the first trial. Do you have any idea why this happens?