I faced a problem as to remove image with JS code like a...
... document.getElementById(\'image_X\').src=\'\'
To delete an image in JavaScript (or generally to delete anything), first you should grab the element, then traverse to its parent element, then you can delete the child using removeChild method.
removeChild