Updated to use progressive jpeg in foreground