fixing preview image bug