Fix bug where image would not get deleted from the filesystem.