Fix for the warning when the image resource is not created properly