adding if statement for "View Gallery" button