To get direct help on writing code for you that isn't supported through this forum. You would have to sign up for a premiere support incident and schedule a phone call. I'll do my best to teach you how to fish here, but if you want me to catch the fish for you... that is another service.
The error you are seeing includes a line number. If you put an if statement around the code generating the error that checks to see if the file exists you can avoid that error and replace it with your own customized message. It looks like you are on the right track with what you have done you just haven't done it in the right place.