docs: def _get_image_or_404(identifier, load_image=False):
      """
      Return image matching `identifier`.
  
      The `identifier` is expected to be a raw image ID for now, but may be
      more complex later.
      """
      try:
          image_id = int(identifier)
      except ValueError:
          raise Http404()
  
      ik_image = get_object_or_404(ICEkitImage, id=image_id)
      if not load_image:
          return ik_image, None
  
      ####################################################################
      # Image-loading incantation cribbed from easythumbnail's `pil_image`
      image = Image.open(BytesIO(ik_image.image.read()))
      # Fully load the image now to catch any problems with the image contents.
      try:
          # An "Image file truncated" exception can occur for some images that
          # are still mostly valid -- we'll swallow the exception.
          image.load()
      except IOError:
          pass
      # Try a second time to catch any other potential exceptions.
      image.load()
      if True:  # Support EXIF orientation data
          image = et_utils.exif_orientation(image)
      ####################################################################
  
      return ik_image, image