Add validation to image helper