Function to copy an image data
Fixed a conceptually bug: rendering binary images returns grayscale
Fixed a numerical problem when scaling binary images