Made img helper more flexible