Fixes #1 - use ImageSpec to detect image types