use temp dir to save image.