Add flags attribute to category.
Bugfix: support categories with no image