Fix #20, #21: Various enhancements to file preview