added a couple optimizations
added a couple optimizations

vfrancis/photosharing-nodejs,anthonydresser/photosharing-nodejs,Milstein/photosharing-nodejs,dlipeles/photosharing-nodejs,walidkur/photosharing-nodejs