c# – Sort and Delete duplicate image files

You don’t need to store whole file contents, compute hash instead.

using (SHA256 sha = SHA256.Create())
using (var ms = new MemoryStream())
{
    image.Save(ms, ImageFormat.Jpeg);
    data = Convert.ToBase64String(sha.ComputeHash(ms));
}

2nd option

if (!uniqueData.Contains(data))
{
    uniqueData.Add(data);
    // ...
}

Can be simplified to

if (uniqueData.Add(data))
{
    // ...
}

Also twice getting the directoriry files can be once

string() files = Directory.GetFiles(imageFolderPath);
int fileCount = files.Length;

foreach (var file in files)
{
    // ...
}

And finally this one

if (!Directory.Exists(yearDirectory))
{
    Directory.CreateDirectory(yearDirectory);
}

Directory.CreateDirectory creates directory if it not exists, otherwise it does nothing. You can remove Exists check.

Directory.CreateDirectory(yearDirectory);