made jpg/png check case insensitive.