fixed a bug in svg viewer when switching categories