modifications to fix gallery and first media query