fix js errors after image moves