How do I display an image in a picturebox using a variable name?

string name = "photo.jpg";

pictureBox1.ImageLocation = name;

// or

Image image = Image.FromFile(name);
pictureBox1.Image = new Bitmap(image);

neither is working. I'm getting the small box with an x in it.

Any help? Thanks

sorry, I figured out what I did wrong. I was using an array and I had the wrong index.