Added imagejpeg function