Fix bug with image weight