changed init_jpeg to return error codes instead
got rid of unused err.h includes