Optimize image contrast