added code for gallery and form