add logic to handle various image states

* missing base image
* ensuring lock is unlocked