code: def _download_images(data, img_cols):
    
  
    images = collections.defaultdict(list)
    for d in data:
      for img_col in img_cols:
        if d.get(img_col, None):
          if isinstance(d[img_col], Image.Image):
            # If it is already an Image, just copy and continue.
            images[img_col].append(d[img_col])
          else:
            # Otherwise it is image url. Load the image.
            with file_io.FileIO(d[img_col], 'rb') as fi:
              im = Image.open(fi)
            images[img_col].append(im)
        else:
          images[img_col].append('')
  
    return images
docs: Download images given image columns.