Fork from EXT:chgallery to be compatible with TYPO3 6.x