start rewriting image preview code
start rewriting image preview code

I've been adding features very badly; rewrite the code so that functions can be
shared across different views (file and diff).

Currently it only rewrites preview on file view.

myakura/curcuma