Adds support for simple image preview, and paves the way for adding viewers for additional file types. Images are previewed automatically if they are small enough (<10 MB), otherwise the user has to request it by clicking on a preview button. For text files (the fallback viewer) the user always has to press the button to open the viewer.
Also solves some issues with the text preview scrolling.