The issue might be caused by one of the following:
Incomplete or Corrupted Base64 String
Ensure the Base64 string is complete and correctly formatted. If it starts with a prefix like data:image/jpeg;base64,, you need to remove this before decoding.