Discard MT when the image is deleted (see #9741)
Fix indentation
Merge pull request #869 from jburel/delete-image-mt

Discard MT when the image is deleted (see #9741)