VID-1854 Refactor media gallery helper to allow all gallery sizes
/CC @lizlux