added Alok's changes to image deletion