replacing throw error with callback error

Hi billyeh,

I have finished changes to jpeg addon part to get error in a callback way.

Waiting to get your feedback.

Jul