Trying to use pil for creating grid-like layout from images. But that code only draws first column. Can anyone help me?
def draw(self):
    image=Image.new("RGB",((IMAGE_SIZE[0]+40)*5+40,(IMAGE_SIZE[1]+20)*CHILD_COUNT+20),(255,255,255))
    paste_x=(-1)*IMAGE_SIZE[0]
    paste_y=(-1)*IMAGE_SIZE[1]
    i=0
    for a range(5):
        paste_x=paste_x+IMAGE_SIZE[0]+40
        j=0
        for b in range(4):
            paste_y=paste_y+IMAGE_SIZE[1]+20
            image.paste(Image.new("RGB",IMAGE_SIZE,(0,0,0)),(paste_x,paste_y))
            j=j+1
        i=i+1    
    out=NamedTemporaryFile(delete=False)
    path=out.name
    image.save(out, "PNG")
    out.close()
    print path