Fixed some image mime type related bugs