Moved auxiliary functions to the end of file
More tests for gd.Image.prototype.watermark()