bug fixes in processImage