def get_photo_detail(g, pid):
	"""Retrieve the download link and description of a photo."""
	photo = g.get_object(id=pid, fields='name,images')

	# Find the largest image.
	pixels = 0
	link = None
	for image in photo['images']:
		h = image['height']
		w = image['width']
		p = h*w
		if p > pixels:
			pixels = p
			link = image['source']

	# Get the description if exists.
	desc = photo['name'] if 'name' in photo else ''

	return link, desc