Fix for image check in .js