better base64 autodetection