refactor so fail can take images