Added jpeg function