split helper functions to helper.js, and implement widht, height query parameter
Change foo.json to input.json.