Use mime.TypeByExtension instead of the local mimeMap

Also makes sure the detected type is never empty (defaults to application/octet-stream)

*DISCLAIMER:* untested, and edited from GitHub so I didn't even run "go run" or gofmt on it (you don't seem to be using gofmt anyway)