img: Allowing ONSUCCESS & ONFAILURE override

At build time, if ONSUCCESS or ONFAILURE is set, let's apply the default
setting on the bootable image unless keep it as default