image preview bug fix