added javascript to preload image