CGImage error fixed