updated image model to validate after declaring attachment