[PhotoActivity]Partial refactoring done.

Reorganized the code, now it's more readable.