Perfect absorption and giant magnification with a thin metamaterial layer