fixed a huge bug in copycast for different image sizes