I wouldn't do this. {$imagesDir} is the right way to do it. If you put the exact url there with http what happens when you look the page under https? A security warning. Your code looks ok however it could be the width and height with IE - put there your image dimensions