Watermark + Crop + Resize with GD / GD2

Anyone have any experience ? This page has a lot of info, but I can’t put it together all by myself, who can help me ?

Here is what I need:
The input is a JPG of 1280x852px.
From this I need 3 outputs:

  1. 1280x852px sized with watermark (merged from a PNG)
  2. a 520x346px resize of this same image, with a different watermarked (alsfo from PNG)
  3. a 88x88px Thumbnail with a border from a 88x88px transparent PNG.

These are needed to be run on all files in a specific directory.
The outputs of #1, #2 and #3 also need to be renamed with a prefix (lg_, med_ and th_)

Who has some GD experience ?