added OS 10.8 compat by using base64Encoding instead of base64EncodedStringWithOptions if base64EncodedStringWithOptions not avail