Manage ImageData pixels with unique_ptr.

This should clear up any remaining possibilities for memory leaks.