change gallery markup to fix display