Fixes bug in image dimension extraction.