Fix previous commit

Previous commit always skipped the <figcaption> tag... so fix the condition
 
Looks kinda ugly though, probably not the right way to do it, first time looking at the code, so I dunno.