Adding an image upload table How is it possible to add an image upload table in the code of a custom module in Drupal 7?

In other words, I want to add the "Images Table" (the one with drag-able rows) to a custom form I'm creating in my custom module. And I need all it's options too, like thumbnail, title and description fields for each uploaded image row plus the remove button, with the ability to limit the number of uploaded images of course.

What is the code to be used to achieve that?

Thanks for your time and help in advance.
Image upload fields and drag &amp; drop tables are two separate elements that you can combine in your module by using a form callback function to declare your fields and a theme function to theme the upload fields in a drag &amp; drop table.

D7 Form API provides an upload field named 'managed_file'. The documentation provides a clear example: 

&lt;?php
// Use the #managed_file FAPI element to upload an image file.
$form['image_example_image_fid'] = array(
  '#title' =&gt; t('Image'),
  '#type' =&gt; 'managed_file',
  '#description' =&gt; t('The uploaded image will be displayed on this page using the image style choosen below.'),
  '#default_value' =&gt; variable_get('image_example_image_fid', ''),
  '#upload_location' =&gt; 'public://image_example_images/',
);
?&gt;


Then you can have a look at the documentation to setup the field with your desired settings. This element does not have a #multiple setting. So you can either generate many fields, either add new fields using ajax as in cck in D6.

Finally you can check this documentation on how to use drupal_add_tabledrag();