gallery output fix