HTML errors in gallery render