Fixed an issue when the image has dimension attrs