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