Fixed moderation of images.

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