cgImage to nsimage that works on gpu while sandboxed