Vanity can apply to both insecurity and egotism.