make popup window fit to pic size