(bug 43964) Invalid value of "link" parameter in <gallery> no longer produces a fatal error

Also added a test for this just in case someone wants to break this :)

Change-Id: I2782cf1a45b574eb5fd69b1c1be561e7bdaef59e
Merge "(bug 43964) Invalid value of "link" parameter in <gallery> no longer produces a fatal error"