Prisoners train dogs, prevent pets from being euthanized