added distributing the data to the threads by pixels