added load from JPEG on the C side with libjpeg
use new jpg loading
switched to memcpy
remove dead code
added nav switcher