auto window resize when image loaded