Images are of course rectangular by nature. What you could do is cut a rectangle out of the center of the image, and then place a white mask, or transparent mask in the shape you desire ( a circle) over top of it.

Can you give us the commands with all the variables filled in? It is very hard to diagnose without all the details, and having to fill in the varables.
You can get a copy of the commands by adding a 'set -v;' to the start of each system call
so the command exectuted is 'verbosely' output to the caller.

There are some php examples on my site - see my signature - including some circle example. Some of them could probably do with a tidy up.
Confirm what you want to do. This example of Anthony's can be written like this using php and the comand line: