Fixed issues with image resize