upload image and create preview image