Some contacts have photos because the iPhone imports the contact's photo from Facebook, if the contact has a Facebook account linked to their phone number.