error handling

raise Exception when jpg.js is not loaded