Before
this.pictureBox1.Image = Image.FromFile(files[currentCount]);
this.pictureBox1.Image = Image.FromFile(files[currentCount + 1]);
You Need to Do this :
if(this.pictureBox1.Image != null)
{
this.pictureBox1.Image.Dispose();
this.pictureBox1.Image = null;
}
you need to dispose the old image before assign new image in your timer tick.
Also For :
this.countLabel.Text = (currentCount + 1) + "/" + numberOfImages;
you better make it this way :
this.countLabel.Text = string.Format("{0}/{1}",(currentCount + 1) ,numberOfImages);
cause using + with strings will create new string to contact
Edit :
well this is the only leaks I can find on your posted code, memory leaks is tricky and hard to catch if you don't have the right tools.
For start don't use Windows Task Manager to detect leaks because it's not accurate instead use Memory Profiler program to help you.
Here some useful links to help you with your search :
How to detect and avoid memory and resources leaks in .NET applications[
^]
Garbage Collector Basics and Performance Hints[
^]
How to measure the total memory consumption of the current process programatically in .NET?[
^]
8 Most common mistakes C# developers make[
^]