closed #12

Works now with extension JPG too; thanks to Axel.