Bug fix
Bug fix

Fixed bug introduced in last cleanup. $state was not injected
into mainController properly, and required being wrapped in a
call to $timeout to execute properly

nwf839/photo_app,nwf839/photo_app