Refactor code for <img> size calculation during attach

Based on the changes in revision 155294, the call to setImageSizeForAltText was being
done twice when the "src" changed between non-empty URL to a empty one . First by
RenderImageResource::setCachedImage and then follwed by a explicit call to
setImageSizeForAltText in attach. Added checks to avoid unnecessary call to
setImageSizeForAltText.

Review URL: https://chromiumcodereview.appspot.com/22145005

git-svn-id: svn://svn.chromium.org/blink/trunk@155583 bbb929c8-8fbe-4397-9dbb-9b2b20218538