Pion emission in 2H, 12C, 27Al, gamma pi+ reactions at threshold