fix some bugs of extension of photo file