convert byte to image and storing image locally