fix setting image height/width from metadata