The diff for this function in github looks really strange... in reality, my edits copy the pattern of the photo function above (which more-or-less leaves the second half intact).