fix image type detection regex utf8 issue