fix memory leak when importing many images. #98