Added some checks in code to avoid PHP Notices

Hi everybody!
I cleaned up my error logs today and stumbled upon some errors in the zoom-image plugin. So here are my fixes.

Sorry for accidentally adding a file of my IDE - I removed it afterwards again.