Kernel crash when converting pngs to gif on julia 1.7.3


I just updated my Julia version from 1.6.1 to 1.7.3 and my previous function (stolen on a forum) to convert pngs to gif, doen’t work anymore for a large number of pngs (1000) but works fine for a small amount of pngs (200). With julia 1.6.1 The gif was created on the disk and edited during the writing, but now Julia 1.7.3 wants to write directly the entire gif on the disk then it doesn’t work anymore.

The function:

function pngstogif(dirpngs, dirgif, name, fps)
    list = readdir(dirpngs)
    a = size(load(string(dirpngs,list[1])))
    l = length(list)
    imgs = rand(RGB{N0f8}, a[1], a[2], l)
    for i in 1:l
        imgs[:,:,i] = load(string(dirpngs,list[i]))
    end, name, ".gif"), imgs; fps = fps)

I modified this function to have something that works fine and makes gif of ~200 pngs for Julia 1.7.3, and sometime I just use Julia 1.6.1 if I really want all the pngs.

But I was wondering if there is a solution in 1.7.3 to use all my png stack ?

 # For julia 1.7.3:
FileIO v1.15.0
ImageIO v0.6.6
ImageMagick v1.2.2

 # Julia 1.6.1
FileIO v1.15.0