correcting jpeg when setting quality