reusable single photo function