added differentiation of image types in optimization.