Prosocial behavior and reputation: When does doing good lead to looking good?