implementation of image_generator. Qiu

still waiting for the new reporter (webapp). 
but the pull request is bigger and bigger. so need to merge.