import base64


def get_photo(photo):
    """
    Extract the photo data (if it exists) from a vCard 'photo' field.

    :param photo: the input vCard 'photo' field.
    :return: a base64-encoded string containing the photo data.
    """
    if photo is not None:
        photo_data = base64.b64encode(photo)
        photo_data = 'data:image/jpeg;base64,' + photo_data.decode('utf8')
    else:
        photo_data = ''

    return photo_data