public void service(HttpServletRequest request, HttpServletResponse response) throws FormatterException {
String numCols = (String) getParameter("numCols");
numCols = numCols == null ? "3" : numCols;
int cols = Integer.parseInt(numCols);
Section currentSection = getNavigationManager().getCurrentSection();
ResourceGalleryManager resourceGalleryManager = UIServices.lookup().getResourceGalleryManager();
GraphicElement[] galleries =
currentSection != null ?
resourceGalleryManager.getAvailableElements(currentSection.getWorkspace().getId(), currentSection.getId(), null) :
resourceGalleryManager.getAvailableElements();
if (galleries.length > 0) {
renderFragment("outputStart");
for (int i = 0; i < galleries.length; i++) {
GraphicElement gallery = galleries[i];