If the image uses the xowiki page as the parent, it will automatically be deleted if you use content::item::delete as this deletes the children of an item as well. At least luckily this is the behaviour I have seen in our glossar package when using content::item::delete 😊. So I'm not sure why you need dave's image upload.