There are probably some more stale image transfers records,
can you please check whether 'image_transfers' table is empty?
If not, you can try removing them by executing:
"DELETE FROM image_transfers WHERE command_id NOT IN (SELECT
command_entities.command_id FROM command_entities);"
(you can simply prepend it to
that's how it worked and the update was successful. Thanks!