I recently had to base64 encode all images into an HTML file and I did it in the source I was still working on. In case I ever have this problem again, here's a short program that will encode all images automatically.