Python37/PIL Image. Cant paste image in square with a loop

I can't achieve to paste images in a square form (if I choose 9 has the n_album, I should have a 3x3 collage). It only works for 1x1, if it's more it will paste the same image where another image is supposed to be.

Here is my code:

def make_montage(n_album, path):
    x_offset = width    #Constant resized image width
    y_offset = height   #Constant resized image height
    c = []
    x = 0
    img ='RGB', (n_album*height + y_offset*2, n_album*width + x_offset*2), color = (0, 0, 0))

    for file_name in os.listdir(path):
        print(f"Processing {file_name}")

    print(f"root of n_album = {int(math.sqrt(n_album))}")
    #Loop in square
    for i in range(int(math.sqrt(n_album))):
        for j in range(int(math.sqrt(n_album))):
                cover =, c[i + j]))
                print(f"Pasting {str(c[i + j])}")
                img.paste(cover, (int(i * height + y_offset), int(j * width + x_offset)))
                print("Je code mal mdr")'{path}\\{n_album}x{n_album}_musical.png')

    for file_name in os.listdir(path):
        if file_name != f'{n_album}x{n_album}_musical.png':
            print(f"Deleting {file_name}")
            os.remove(os.path.join(path, file_name))

And here a result for a 2x2 with images of (the order it was supposed to paste); Link, Mario, Princess Zelda, Peach Result