code: def base64ToImage(imgData, out_path, out_file):
          
          fh = open(os.path.join(out_path, out_file), "wb")
          fh.write(imgData.decode('base64'))
          fh.close()
          del fh
          return os.path.join(out_path, out_file)
docs: converts a base64 string to a file