fix setting image height/width from metadata
test displaying images with shape metadata
use jQuery attr instead of setAttribute

when appending images.

This was an optimization with no apparent performance benefit.
try assertType instead of NotEquals, null
Merge pull request #4853 from minrk/imgmd

fix setting image height/width from metadata