Fixed extracting layers from image

Before it threw an exception because #{filename}.#{newformat} didn't
exist, but when extracting layers we should check for #{filename}-0.#{newformat}.
Merge pull request #203 from FlavourSys/master

Fixed extracting layers from image