check for mimetype on avatar

put a bit to resolve this issue #508