add multi thread support, plain image support