code optimization for image in 2.0.0