added delete image logic