def METHOD_NAME(page, settings, objtype):
    """
    Returns a dict of all fields that has the related_model of objtype as well as their metadata.
    Arguments:
    page -- Page instance with supported fields.
    settings -- Settings dictionary from main method.
    objtype -- Image, Document from Wagtail.
    Returns:
    A dictionary of fields with their respective metadata.
    """
    data = json.loads(page.to_json())
    if objtype == Image:
        related_model_by = "<class 'wagtail.images.models.Image'>"
    elif objtype == Document:
        related_model_by = "<class 'wagtail.documents.models.Document'>"
    else:
        return {}
    objects = {}
    for field in page._meta.get_fields():
        if field.related_model and str(field.related_model) == related_model_by:
            if data[field.name]:
                try:
                    # Get the object instance.
                    instance = objtype.objects.get(pk=data[field.name])
                    # Null the object if the filesize is larger.
                    if instance.file.size > app_settings['max_file_size'] and settings['ignore_large_files']:
                        objects[field.name] = None
                    else:
                        objects[field.name] = instance_to_data(instance, null_users=settings['null_users'])
                except (FileNotFoundError, objtype.DoesNotExist):
                    logging.error("File for " + str(field.name) + " is not found on the environment, skipping.")
                    objects[field.name] = None
            else:
                objects[field.name] = None
    return objects