Added validation checks to gallery page