def _load_image(filename: str, size: Tuple = None) -> ImageType:
    """loads a PIL image with optional resizing

    Args:
        filename (str): _description_
        size (Tuple, optional): _description_. Defaults to None.

    Returns:
        ImageType: _description_
    """
    im = load_image_from_path(filename, {})
    original_size = im.size
    if size is not None:
        im = im.resize(size).convert('RGB')
        
    return im,original_size
loads a PIL image with optional resizing

    Args:
        filename (str): _description_
        size (Tuple, optional): _description_. Defaults to None.

    Returns:
        ImageType: _description_
    
src/marqo/s2_inference/reranking/cross_encoders.py