Complete get tags using figure legend function.

Modified the structure of database.