#198 divide photoupload function