Changing Image SRC with a value saved in a cookie

So if example 1 does not work but example-3 works, what could be the reason ?

Maybe you get something else from —> session . getItem ( “myimage” ) <---- then you expect?

Did you check it?
What do you get here in CONSOLE ?

import{session}from'wix-storage';

$w.onReady(()=>{
	let sPhoto=session.getItem("myimage");
	console.log(sPhoto);
});

What is the result?
So if you get NOTHING, then you found your issue.