Performance: Avoid API requests by reusing image expansions

Rendering an image involves an API request to retrieve image metadata (whether
it exists, dimensions etc). This is expensive for the API cluster.

This patch avoids the API load for most normal edits by reusing the expansions
for unmodified image expansions from a cached DOM similar to transclusion and
extension content.

Change-Id: I80139a8e7e4be6d34340f007b2a980b641a4c6eb
Merge "Performance: Avoid API requests by reusing image expansions"