Display Image Of Currently Selected Product.

Hello,

I am trying to figure out how to show an image of the currently selected product on the product page. I am doing this as I want to separate the image from the other elements like description, price, etc.

I tried using this but did not know what to do next.

$w('#productPage1').getProduct()
 .then((product) => {
 let productImage = product.mainMedia;
    $w('#image1').src = productImage
  

If I use a dataset that is linked to products it doesn’t change no matter which product you select.

I feel like this should be easy but I am just not getting it.

Any help would be great!