Removes unnecessary image reference.