How to add an image field to a programmatically created form?
You cannot use fields from the Field API in forms of the Form API directly, as Fields can be used directly in entities, and entities can be used directly with forms. 

Instead, you can use the approach described here, as Clive kindly pointed out. Alternatively, you can use ctools_field_invoke_field() function of CTools module too.

The two fields 'file' and 'managed_file' of the Form API are similar, with the difference that the latter provides a progress upload widget. Also, managed_file will add the file entry to a table with the same name. Beyond that, there is some work involved in order to render the file on a page, and that is not the imagefield of the Field API.