fix image existence check in remove_image utility