How to convert .avi video that has 1 static image in the video (with sound) to mp4 video with ffmpeg to least possible size?

You should check if the video-part is really a factor by separating the A/V-components

with ffmpeg this works with

#retrieve audio-only
ffmpeg -i <<VideoName>> -vn -acodec copy -f <<AudioCodec>> output.audio
#retrieve video-only
ffmpeg -i <<VideoName>> -an -vcodec copy -f <<VideoCodec>> output.video

If the video is really significant in size, one possibility would be to create a screenshot of it, and use the image as input for the video-coder, instead of recoding the videostream

see ffmpeg.org/wiki for reference

#create screenshot from video
ffmpeg -i <<VideoName>> -ss 00:00:01.0 -f image2 -vframes 1 output.screen.png

You can see on this stackoverflow-post how to make a video from a still


Try the following command which is removing the image and the audio separately then reassemble:

ffmpeg -loop 1 -shortest -y -i image.jpg -i audio.amr -acodec copy \
-vcodec video.avi video.mp4