fix guessing of category/group id in setLogo
The ID is guessed so it can be used on the folder structure. This needs to be handled differently as if two users create a category/group at the same exact time it could result in both receiving the same ID. Possibly move image storage to AFTER category/group storage in order to have more safe ID usage. This is VERY VERY unlikely, but possible.