Hello Hazy,
Is "rect" exactly the same as the image in PaintImage? Might sound like a daft question without the pixel and colour tolerances it must be exactly pixel-for-pixel identical, as do the colour values right down to the 1-significant bit.
Even with files upon saving re-sampling can take place which can make them different.
Differnt graphics cards and resolution can rended images differently as well.
Try adding some tollerances.
I had the same problem and a pixel tolerance of 0.75% (of the total pixels in the image being searched), and 42% colour tolerance (In absolute terms = 255*42/100) seemed to solve the problem. These were found by trial and error by the way but worth it.
The colour depth eg 24 or 32-bit should ideally be identical, but it's not so critical with the correct tolerances.
(I found working with percentages easier to manage as the same parameters can be used for all my images irrespective of size.)
Another factor that improved recognition was adding larger transparency margins around the images although that may be something you do't have any control over.