now supports jpeg and other formats