bug fix in image utils