fix minor bugs and clean up photoshare code before refractor login
structure