add photo flow function