Are you sure that the buttons' backgrounds aren't changed? Maybe they are changed but, to
ImageBrushes with the same image.
Since you use
Random for generating the images' indices, maybe you got the same indices for the buttons. Try to store the current index for each button and, check that the new indices are differnet from the old indices.