lowercase extension in switch case. fixes #253
png should not depend on quality variable. PNG has just compression variable.