properly set image width and height attr, work on firefox now, window resize work now