add options for image output format, add checks for return codes