[PhotoActivity]Fixed a bug in db connection