fix bug in case of None mimetype
fix file formats bugs