some base64 / data uri scheme tidy up as per code review