delete image mostly working correctly now