adding pic expanding function