photo create function fix