Fix up the finalize function.
Handle if we don't have a size and are asked for an NS- or CIImage on OS X.