Is it possible to change an images source image by code? C#

Im making a game were I want my background image to change between hundreds of different images that I have in my assets folder. Is there a way to do this by code? I have my Image “testImage” decleared in my script and I have dragged the Image gameobject to the slot in inspector. In my project assets I have the other source image that I want to change to called “NewSourceImage”. I have tried with this code but it doesnt work:

  public Image testImage;
     
   public void Change()
     
     {
       testImage = GetComponent<Image>("NewSourceImage");
     }

I get the error message: error CS0308: The non-generic method `UnityEngine.Component.GetComponent(System.Type)’ cannot be used with the type arguments

Here is code to change an image

public Image myImage;

public void Change(){
    myImage.sprite = someOtherSprite;
}

Here is code to load a sprite from the resources folder.

public Sprite someOtherSprite;

public LoadSprite (){
    someOtherSprite = Resources.Load<Sprite>("NewSourceImage");
}

Here is both of them put together in a sensible structure.

public void ChangeImage (string newImageTitle){
    myImage.sprite = Resources.Load<Sprite>(newImageTitle);
}

Resources.Load() is always returning an Object because it can nearly load anything, which means you need to cast the result into what the loaded resource will be.

spr = Resources.Load ("newSourceImage") as Sprite;

or

spr = (Sprite) Resources.Load ("newSourceImage");

My guess is that line 9 will also throw an error, because it does not match the preceding answer.