fixing bug for images