getAllCategories function in Images_SDB