Prisoners, shelter dogs get new lease on life through program