Getting error "image_url is not defined" on image edit

Trying to run the sample code:
https://platform.openai.com/docs/guides/images/usage?lang=node.js

const response = await openai.images.edit({
model: “dall-e-2”,
image: fs.createReadStream(“image1.png”),
mask: fs.createReadStream(“mask.png”),
prompt: “A man with beautiful black hair”,
n: 1,
size: “1024x1024”
});
image_url = response.data[0].url;
console.log(image_url);

My images fit the criteria:
“The uploaded image and mask must both be square PNG images less than 4MB in size, and also must have the same dimensions as each other”

I get the following error:
“Uncaught ReferenceError ReferenceError: image_url is not defined”

The result URL shows the original image as the outcome.
(annoyingly and rudely it charges my credit even for every such failure).

What I tried: I thought it’s a matter of version of NodeJS so I upgraded it and it didn’t help.
When running the sample code that generates image based on prompt (“create image”) it runs well so I am assuming the issue is with uploading my images.

Please help. Thanks.