properly set error code
issue #564: better automatic mimetype detection for assets

also added possibility to override automatic detection with hard-coded value from manifest