Yo lo puse justo antes del mysql_free_result.
Código HTML:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Documento sin título</title>
</head>
<body>
<table width="46%" cellpadding="0" cellspacing="0">
<form action="<?php echo $editFormAction; ?>" method="POST" enctype="multipart/form-data" name="form1">
<tr>
<td colspan="3" align="left" class="txtgris">foto pequeña</td>
<td width="75%">
<input name="foto" type="file" id="foto">
</td>
</tr>
<tr>
<td colspan="3" align="left" class="txtgris">foto grande</td>
<td><input name="foto_g" type="file" id="foto_g">
</td>
</tr>
<tr>
<td colspan="5" height="2" >
</td>
</tr>
<tr>
<td colspan="4">
<input name="enviar" type="submit" id="enviar" value="Enviar">
<input type="hidden" name="MM_insert" value="form1">
</td>
</tr>
<input type="hidden" name="MM_update" value="form1">
</form>
</table>
</body>
</html>