C# pixel sorter