Not sure why that would happen. That function should be called only on the backend and not on the frontend. By any chance, are you using gallery shortcode or gallery option in theme options? If so, can you pls check if removing that helps?
All set it was actually a plugin called WordPress Download Manager. I deactivated it and the site came back up. Amazing what plugins can do. I am learning alot and trying to stay with ones that work with the themes I have which is yours and the avada theme. view screen shot.