image processing related fixes