Much faster now, takes a row of pixels for each image