jpg support

Returned jpg support to kplib.c