Added API to have per-plane userdata for own-allocated images.
Merge pull request #65 from fancycode/plane_userdata

Added API to have per-plane userdata for own-allocated images.
fix memory leaks