WebJournal: fix image dimension retrieval

* When trying to retrieve the dimension of an image (to keep
  the correct ratio when explicitely setting width/height),
  consider that the fetched image might not be reachable and
  could be returned as an HTML (error message, login page, etc.)
  Try to analyze the image only when the content-type indicates
  an image.

Signed-off-by: Jerome Caffaro <jerome.caffaro@cern.ch>