add deleting images algo