I have an image with a yellow vase in the foreground and transparent background:
I would try either setting the stroke color and line width before your call to CGContextDrawImage, or tweaking the shadow (opacity, blur, etc) so that it looks like a stroke around the image. Let me know if this works!
CGContextDrawImage