Simple encoding seems to be working. Missing header details and actual image shaping