fixing the image overflow problem