code: def downloadSessionImages(server, filename=None, height=150, width=150,
                            opacity=100, saturation=100):  # pragma: no cover
      
      info = {}
      for media in server.sessions():
          url = None
          for part in media.iterParts():
              if media.thumb:
                  url = media.thumb
              if part.indexes:  # always use bif images if available.
                  url = '/library/parts/%s/indexes/%s/%s' % (part.id, part.indexes.lower(), media.viewOffset)
          if url:
              if filename is None:
                  prettyname = media._prettyfilename()
                  filename = 'session_transcode_%s_%s_%s' % (media.usernames[0], prettyname, int(time.time()))
              url = server.transcodeImage(url, height, width, opacity, saturation)
              filepath = download(url, filename=filename)
              info['username'] = {'filepath': filepath, 'url': url}
      return info
docs: Helper to download a bif image or thumb.url from plex.server.sessions.
  
         Parameters:
             filename (str): default to None,
             height (int): Height of the image.
             width (int): width of the image.
             opacity (int): Opacity of the resulting image (possibly deprecated).
             saturation (int): Saturating of the resulting image.
  
         Returns:
              {'hellowlol': {'filepath': '<filepath>', 'url': 'http://<url>'},
              {'<username>': {filepath, url}}, ...