only display gallery legend if not empty