error handling when script loaded

throw exception when jpg.js is not loaded