use b64 instead of data URIs, fix bug with multiple file handling