conver image into byte string and save with given name