Guard against double insertion.

This was a problem when the gallery was opened before the page was
done parsing.