Makes sure the aria-invalid attribute is removed when the caption is
removed and not updated (#12517)

Change-Id: I750dff060469a656e199985984794f186365f121