Image preview

Added in image preview into the script on index.html.
Moved arrayBufferToDataUri(arrayBuffer) function 1 level lower