img.invalidate() might be needed for some devices