Copy CGImageRef in order to prevent BAD_ACCESS in some concurrent situations.