Fixed moderation of images bug.

The mysql queries were done incorrectly. Most likely an artifact of my previous pull request.