fix #48 by detecting file type using jmimemagic Java library