imagecopymerge() optimizations and fixes for pct < 100

git-tfs-id: [http://falcon:8080/tfs/Projects]$/Phalanger/Main;C4254