code: def _find_image_ext(path, number=None):
      
      if number is not None:
          path = path.format(number)
      path = os.path.splitext(path)[0]
      for ext in _KNOWN_IMG_EXTS:
          this_path = '%s.%s' % (path, ext)
          if os.path.isfile(this_path):
              break
      else:
          ext = 'png'
      return ('%s.%s' % (path, ext), ext)
docs: Find an image, tolerant of different file extensions.