updated app.js file for to capture images