рони,
так лучше?
var image = document.getElementById("myImage");
image.addEventListener("click", function(){
if (this.classList.contains("changed")){
this.src = "style/images/img1.png";
this.className = "";}
else{
this.className="changed";
this.src = "style/images/img2.png";}
});