basic image working programmatically