Moved some to utils, remove temp images after processing.