converted image buffer to verilog parts of the original jpeg encoder