fix for newer versions of firefox

worked on v15, doesnt work on 18. fixed the way image data is cloned.