gallery validation fix