Presentation of picture based on previous response

In almost all cases I would recommend you use Builder and then add code components to customise, rather than writing in Coder.

Have a look at some of my demos to see how variables can be used in code components and other builder components

You could have ‘left’ for left picture and ‘right’ for right picture as keyboard responses. Then use a code component to set chosen_pic as image1 or image2. Then in Begin Routine, set image1 (or image2) as chosen_pic and the other one as newImage (if this is the name of your column of image names in your spreadsheet).