wrong logic in img tag