Only use file extension to resolve a file UTI as a last resort

file extensions on folders can be misleading. Fixes #1742