add a parameter to set the image quality