Added check to see if galleries exist.