def check_images(images):
    """ Validates the data received via ajax

    First it checks to see if the data can be converted to a python object.

    Then it checks to see if it is a list of (str, int) tuples

    Arguments:
    :param images: a supposed string representation of list of (str, int)
    tuples
    :type images: str
    :returns None or a list
    """
    from ast import literal_eval
    try:
        images = literal_eval(images)
    except:
        return None
    if isinstance(images, list) and len(images) > 0:
        for image in images:
            if isinstance(image, tuple) and len(image) == 2 and isinstance(
                image[0], str) and isinstance(image[1], int):
                continue
            else:
                return None
        return images
    else:
        return None
