add setInterval update_latest_photo, add format.json to index action in photos_controller to deal with update_latest_photo ajax request.