test(gallery): add coverage for gallery and gallery-modal

Refactored gallery-modal to a standalone component and moved logic to template.