Fix copy constructor and assignment operator in HeapImage