refactoring the images and categories