Re-Implement Document.js to fix quick switch and render images.