I'll be honest but it would be quite redundant to be writing a tutorial for PayPal's IPN considering they provide a vast documentation about this along with code samples and an amazing sandbox for you to play with. Just to make things easier, here are a few websites I have used in the past:
PayPal IPN:
You must be registered to see links
PayPal Developer Network:
You must be registered to see links
You must be registered to see links
PayPal Sandbox:
You must be registered to see links
That is all you really need. If you are thinking of a full-fledged billing system that utilises PayPal (mainly), then you should be considering PayPal's SDK. Otherwise, you can construct a simple script to deal with PayPal IPN.
Just a few tips too, you will be required to have either a "Premier" or "Business" account to make use of this wonderful feature. Also, when creating your PayPal form on your website, set the 'return', 'cancel_return', and 'notify_url' params for PayPal, whereby, the 'return' is the success page, 'cancel' obviously the failure page and 'notify_url', the page that will process PayPal's payment notification.
PayPal provides a few nice examples on notification handling so maybe you should look there too. One last thing, most users would utilise the 'custom' field when processing the IPN reply. All you are really checking for if the status is VERIFIED or INVALID. But yea, there are many ways to do this.
You must be registered to see links
EDIT: Didn't see this earlier:
Anyways, I presume you already have a MySQL table setup for this with a field of data type 'blob' along with some basic knowledge of PHP 'File Uploads', if so, all you really need to do is have:
PHP:
$imgfile = addslashes(file_get_contents($_FILES['userfile']['tmp_name']));
Inserted into your database (perhaps as a base64 blob if you wish to convert it). If you wish to display it, just get the specific record and have it displayed through a simple PHP echo, under:
PHP:
header("Content-type: image/jpeg");
Or whatever the image type is, e.g. PNG, GIF, etc.