Add exceptions in getBase64