Dynamiccaly resize window to image size.