'Get the profile picture URL for a person
@param person: the person record (Row)
@return: the profile picture URL (relative URL), or None if
no profile picture is available for that person'

@staticmethod
def profile_picture(person):

    try:
        pe_id = person.pe_id
    except AttributeError:
        return None
    table = current.s3db.pr_image
    query = (((table.pe_id == pe_id) & (table.profile == True)) & (table.deleted != True))
    row = current.db(query).select(table.image, limitby=(0, 1)).first()
    if row:
        return URL(c='default', f='download', args=row.image)
    else:
        return None
