You can set onclick to null for your image-button to disable its onclick event.
document.getElementById("buttonName").onclick = null;
if you need to set a function to onclick event again:
document.getElementById("buttonName").onclick = funcToRun;