don't lose the thing we're attaching the photo to when we change sets. This is a modification of oshiho3's previous fix.
Merge pull request #426 from maco/dev

Put back oshiho3's fix, modified for new parameters