save pic and convert to base64 string