second photo upload added, js outsourced