(Solved) Adding New Image Not Resetting After Choosing New Image

When ever i instantiate a prefab with a specified sprite, the GameObject spawns the first time just fine with the new image. However when ever i click a new button the new image doesn’t reset. If i click a 3rd time the image finally shows. I don’t get why that is?

public void DoSomething(int buttonIndex)
    {

      
          
            if (buttonIndex == 1)
            {
              

                 
                    Debug.Log("Pressed" + buttonIndex);
                    SpriteArray = Resources.LoadAll<Sprite>("Stickers/AccessoriesHats");
                    GameObject clone = Instantiate(_stickerPrefab, new Vector3(0, 0, 0), Quaternion.identity);
                    stickerImage.GetComponent<Image>().sprite = SpriteArray[0];
                    // GameObject newButton = Instantiate(_stickerPrefab) as GameObject;
                    GameObject canvas = GameObject.Find("Meme Create Panel");
                    clone.transform.SetParent(canvas.transform, false);
                  
              


            }
          
          
            else if (buttonIndex == 2)
            {
              
                    Debug.Log("Pressed" + buttonIndex);
                    SpriteArray = Resources.LoadAll<Sprite>("Stickers/AccessoriesHats");
                    GameObject clone2 = (GameObject)Instantiate(_stickerPrefab, new Vector3(0, 0, 0), Quaternion.identity);
                    stickerImage.GetComponent<Image>().sprite = SpriteArray[1];
                    // GameObject newButton = Instantiate(_stickerPrefab) as GameObject;
                    GameObject canvas = GameObject.Find("Meme Create Panel");
                    clone2.transform.SetParent(canvas.transform, false);
                  
            }
}
      


    }

So say i click the button with index 1, that should spawn the prefad with the sprite with the array of [0]. Then if i click button with index 2, that should spawn the prefab with the sprite with the array of [1].

I solved it :). I moved stickerImage.GetComponent<Image>().sprite = SpriteArray[0]; above the line GameObject clone = Instantiate(_stickerPrefab, new Vector3(0, 0, 0), Quaternion.identity);