I figured it out! Just had to make sure when I added the image to the viewport to select “hidden on load”. Also had to make a command for both MouseIn and MouseOut function otherwise it just stays there. I used the code below if anyone else is looking for a simplistic solution for novice coders!
export function button24_mouseIn(event) {
if ( $w('#imagename').hidden ) {
$w('#imagename').show();
}
else {
$w('#imagename').hide();
}
}
export function button24_mouseOut(event) {
if ( $w('#imagename').isVisible ) {
$w('#imagename').hide();
}
else {
$w('#imagename').show();
}
}