1. Are you sure your running it against the proper database tables we are talking you do this after photopost is integrated with vbulletin and after the coppermine stuff is there. All this does is grab a username on a photo entry query the userid from the forum and update it in the photos table
2. error 1 is a permissions issue. either there is permissions issues with mogrify itself or your permissions are not 777 on the data directory at all levels recursively
3. Look at your errors your posting. This script explicitly REQUIRES you to have a working photopost integrated with vbulletin correctly.
You might actually want to send server information and admin login through the contact us link.