Merge "Refactor to support photoviewer controller." into ub-mail-master