fixed picture.js to handle undefined for photo array