adding confidyional for deleting badge if there is no badge image