import re


def _best_resolution(data):
    """Find the best image resolution from post json."""
    highest = 0
    best = ""
    for k, v in data.items():
        m = re.match(r'^photo-url-(\d+)$', k)
        if m:
            width = int(m.group(1))
            if width > highest:
                highest = width
                best = v
    return best