Deduce mime type (fixes #4)