@WalidMujahid it's a generic answer, we'd have to load up the twenty seventeen theme and test it there to check, but you might as well do that yourself
just keep in mind that 'removed all of the gallery images' isn't very descriptive, e.g. I can't tell if it breaks the images, or if it shows an empty gallery, or if the images are there but don't show visually
@TomJNowell "I tired it and it seems to have removed all of the gallery images.". I had put in the functions.php and the images disappear from where they are inserted in the pages