bug fix for image managing