core: use lower case extensions when guessing mime or file extension.