Fixed the output frame misalignment problem (found the right file format P5 instead of P6).