Move photo upload code to DAO; clean up UserPrefs related code;