How to change a function without risk with the update ?

Hi
I need to change the function add_image of ent_product but an update will erase it. 
How can I do?

thanx