added preview photo function