added link formatting for gallery