What version of IM do you have running? The format command is something on the more recent versions and the parameter is JPG, not JPEG. (Although JPEG can be used and is quoted in the example on imagemagick.org).
We had one host that also suggested using JPEG and we manually changed the command to force a JPEG into the command line and this fixed their problem. However, we have been unable to figure out WHY and for WHAT users.
We see some cases where the medium variable are NULL - and usually there is another error concerning the getfilesize() call. Most of the times I have seen this, there has been a permissions issue on the data directory.
Keep in mind, the SERVER has to have access to all these directories. unlink errors usually indicate that the server doesnt have permission to remove a file or the file was never able to be moved there in the first place.
Also helps to know what version of PHP you are using, what version of MYSQL and what version of IM.
GD2 is MUCH better than GD1. GD1 uses a resize and GD2 uses a resample; the quality of the thumbnails of GD2 is as good as IM.
I make probably 40-60 posts a day on PP forums; not sure why you are only getting one response a day.