added gallery validation on the front end