prevent errors when listing broken memberships

If the other side of the membership has been deleted then skip over
listing the details to prevent errors.
we need to leave the li in place as otherwise the code that attaches
edit events to this, which currently doesn't know about the contents of
memberships, relies on them being there to assign id data correctly.

Fixes #405
correct image deletion post url

the POST action URL used on the image deletion form was incorrect
which meant images could not be deleted. Fix this by adding an image url
generating function rather than coding them by hand in the template.

Fixes #407 and #412