Group files by name and type