Minor fixes and pre-implementation of upcoming dynamic gallery