diff --git a/blocks/library/gallery/index.js b/blocks/library/gallery/index.js index 58d721c5a310cc..8089448df38bbb 100644 --- a/blocks/library/gallery/index.js +++ b/blocks/library/gallery/index.js @@ -52,11 +52,7 @@ const editMediaLibrary = ( attributes, setAttributes ) => { // we only need this set to display the image in the library const slimImageObjects = ( imgs ) => { const attrSet = [ 'sizes', 'mime', 'type', 'subtype', 'id', 'url', 'alt' ]; - const newImgs = []; - imgs.forEach( ( img ) => { - newImgs.push( pick( img, attrSet ) ); - } ); - return newImgs; + return imgs.map( ( img ) => pick( img, attrSet ) ); }; function defaultColumnsNumber( attributes ) {