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