``def optimize(thumbnail, jpg_optimize_command=None, png_optimize_command=None, gif_optimize_command=None)``