It now seem to work. bmp encodes images starting from the bottom, juicy from the top. introduced a function to do the conversion