Trouble Uploading To IMGBB

I used to have the upload working fine in mobile but retool changed they way the image upload component worked allowing you to upload more than one image. They also change how it was stored from being base64 to being a blob instead. Since it previously was base64 I was able to easily make a REST API call to IMGBB and upload the image. That no longer works for me.

I have tried using an intermediate JS step to convert the image to base64 but I still get that it is "Invalid base64 string." back from IMGBB. I have tried with and without the replace options below. I am passing the this value to the FormData to IMGBB image={{ImageToBase64.data}}

ImageToBase64 JS code
const base64Data = await utils.getDataByObjectURL(imageInput1.value[0])
let base64Slim = base64Data.replace("data:image/jpeg;base64,/","")
return base64Slim

Any help anyone can provide would be appreciated.

I was able to get it working with the replace options. Maybe the cause was the extra / after base64, in the replace method, removing it was able to make the post request.

const data = await utils.getDataByObjectURL(imageInput1.value[0]);
let base64Slim = data.replace("data:image/png;base64,","")
return base64Slim

That did the trick for me! Thank you!
Not sure why but that slash didn't seem to cause an issue before where it does now but all good now.