SOLVED - Error gallery stop work

if this code is no longer supported, is there any other method to do the same thing? Hopefully we won’t have to resort to that …