Simplify image optimization functions