Fix comparing images code