convert image to preview