Hi,
The image for categories uses strategy attribute to determine how to display category image. This would be on the attributes tab of your category and attribute is: CATEGORY_IMAGE_RETRIEVE_STRATEGY. There are two options for value: "ATTRIBUTE" which is what you need, or "RANDOM_PRODUCT" which will use one of the products's images in your category if there are any.
However it should fallback onto ATTRIBUTE by default and should not throw NullPointerException.
Can I ask which version of YC you are using? and what did you specify in CATEGORY_IMAGE_RETRIEVE_STRATEGY or did you leave it blank?
Regards,
YC team