fix setting image height/width from metadata

Needed updating after some recent metadata handling changes.