added jpeg and png support