Performance improvements in ImageProcessor