After setting the number of width and height before generating for the exactly size I want then when it finished the size would change everytime.