adds cost function image