Corrected the pixel data extraction process