fixed issues related to images in preview