A system and method are disclosed for identifying items, objects, and activities in photos taken by a user, of a user, or shared with a user to target ads. The method works as follows. The user takes photos relating to an interest (interest-1) that he stores in photo library. If a user visits a website relating to another interest (interest-2), and if the website shows ads, the website visit triggers an ad auction. For targeting ads, the system accesses the user’s contextual information relating to interest-2, and additionally the photo library for other interests, identifying interest-1 from the photo library. In the ad auction, the system scores ads based on relation to interest-2, or both interest-2 and interest-1 to determine priority. Finally, the system shows relevant ads based on highest priority. The method increases relevancy and quality of ads to the user without direct input from the user.