Fixed bug 'CGContextTranslateCTM: invalid context 0x0'

Credits: mdb983
Merge pull request #20 from MacMannes/master

Fixed bug 'CGContextTranslateCTM: invalid context 0x0'