def validate_image_collection(sample_collection):
    """Validates that the provided samples are an image
    :class:`fiftyone.core.collections.SampleCollection`.

    Args:
        sample_collection: a sample collection

    Raises:
        ValueError: if the provided samples are not an image
        :class:`fiftyone.core.collections.SampleCollection`
    """
    validate_collection(sample_collection)

    if sample_collection.media_type == fom.GROUP:
        raise fom.SelectGroupSlicesError(fom.IMAGE)

    if sample_collection.media_type != fom.IMAGE:
        raise ValueError(
            "Expected collection to have media type %s; found %s"
            % (fom.IMAGE, sample_collection.media_type)
        )

    # Ensure that the frames view has image filepaths, since the caller may
    # want to directly access the images
    if sample_collection._dataset._is_frames:
        try:
            filepath = sample_collection[:1].values("filepath")[0]
        except:
            return  # empty

        _validate_image(filepath)
Validates that the provided samples are an image
    :class:`fiftyone.core.collections.SampleCollection`.

    Args:
        sample_collection: a sample collection

    Raises:
        ValueError: if the provided samples are not an image
        :class:`fiftyone.core.collections.SampleCollection`
    
fiftyone/core/validation.py