Database functions for image rating system (needs implementation)