def _get_album_by_name(photo, album):
    """Finds first album named album that photo is in and returns the AlbumInfo object, otherwise returns None"""
    for album_info in photo.album_info:
        if album_info.title == album:
            return album_info
    return None