Remove duplicated ImageFormat logic, instead update query string with appropriate format command