Fix gradient image generation with released CFArrayRef