Sounds to me like you are using a variable to append it. I bet if you left the page and returned it would work as expected. Obviously you don't want to do that all the time. If your name code is before the WA code, then just after the WA code empty the variable that holds '.jpg' string. So if you create the variable $time = $time.'jpg' before the WA code, you would write $time =""; after the WA code. Hope that helps.