added local flag (when running in ripple simulator) and testPhotos for debugging main page locally without needing gallery, fixed js