Indeed, DeepL translator doesn't seem to perceive an idiomatic turn (Ça doit être mon imagination.)
In French this locution would not be rendered best by a unique expression usable in any context. In the instance under consideration it can be translated as follows on the count of there being in the difference involved a real possibility for contending the fact; (the possibilities that'll be shown after confer somewhat too much intensity to the denial.)
- Ce doit être une impression. -- Ça ne doit être qu'une impression. -- Ce n'est que mon impression alors. (and more variants)
(If the remark is made to the person, instead of their making it to themselves)
- Ce doit être une impression (que vous avez/tu as). -- Ça ne doit être qu'une impression (que vous avez/tu as). . -- Ce n'est que votre/ton impression. (and more variants)
(if there is no doubt at all)
- Ce/Ça ne peut être que votre/ton impression.
When the a priori falsity of the fact is not subject to much contention although the expressions used in the first case can still be proper, other forms are more apt to emphasise that the situation is perceived falsely;
- Je dois me faire des idées.
- J'ai dû le rêver.
- Je dois rêver. -- Je rêve.
Je rêve! Il n'y a plus un seul fruit dans la panière! Je croyais pourtant manger des fruits ce soir …
(If the remark is made to the person, instead of their making it to themselves)
- Vous vous faite des idées/Tu te fais des idées.
- Vous l'avez rêvé./Tu l'as rêvé.
- Vous rêvez./ Tu rêves.
-- Je crois qu'il me hais, sans qu'il ait le courage de se détourner de moi, en réalité il me hais.
-- (Tu l'as rêvé)/(Tu te fais des idées), il ne vois que par toi, ne parle que de toi!