Web: Quality of resized pictures?

I have pictures with 1000x1000 Pixels.
I had to resize them to 500x500 and 175x175 within my Xojo WebApp.

I’m using this code for the 500x500 Pixels:

        dim p as Picture
        dim f as FolderItem
        f = savePicture
        p = Picture.Open(f)
        p = MZFunc_BildVerkleinern (p, 500,500)
        
        p.save(f.parent.Child("Smaller_" + f.name), Picture.SaveAsJPEG, Picture.QualityMax)

I use Max Quality [100%], but the smaller pictures have big small squared edges.

Do I something wrong? Is there a possibility to use a smoother resize option? A little bit more blurred version of the resizing?

what does MZFunc_BildVerkleinern?

looks picture good in debugger when you look on p?