add comments
detect image size and use different settings based on the result