Solved the problem with deprecated ImageMagick clone function.