added photo logic