added code to determine file type and display icon