Fix deregister and delete
Use proper command on deregister.
Remove image after upload.