Compressing Base64 Encoded Image in Database Field. Table Size too Large
Base64 is an encoding for transferring data reliably over the wire. It usually increases a files size so I wouldn't look to store a file in this format.

BLOB
The first thing I would do is decode the Base64 back to the original file and store it as a BLOB field. This could shrink the files by a third.

Table design
You said each row has a 40kb image. Why are they all the same size? If some rows share the same image then you could put the images in a table of their own and reference them from your big table. 

Limit filesize
Most sites that let you upload an avatar limit the filesize/resolution of the image. Without knowing what these images are for perhaps you could impose a similar limit. You could even rescale the image automatically when they upload it.

Sorry if these are already obvious to you. It's difficult to be more specific without knowing the background about what the images are for.