fix bug when options undefined

Was running into "cannot read property maxImageSize of undefined" when omitting options argument on line 104, since opts is not in that scope. I believe intention is for opts to be in the scope of the primary function.