Fix in metadata: subtract 1 from width & height first (0-based)